//
//  JLYAllshdjxgeuRequest.m
//  Zuisuigirveup
//
//  Created by spdbmacbook0003 on 2025/8/8.
//

#import "JLYAllshdjxgeuRequest.h"
#import <AFNetworking/AFNetworking.h>
@interface JLYAllshdjxgeuRequest()
@property (nonatomic, strong)AFHTTPSessionManager *man;
@end
@implementation JLYAllshdjxgeuRequest
+(instancetype)JLYOnceSendReqMan{
    static JLYAllshdjxgeuRequest *share = nil;
    static dispatch_once_t oncedis;
    dispatch_once(&oncedis, ^{
        share = [JLYAllshdjxgeuRequest new];
        share.man = [share cslasjksjkdjareateReqMandkalkclsdkoalklxzlaldlkdkka];
        //  [share cslasjksjkdjareateReqMandkalkclsdkoalklxzlaldlkdkka];
    });
    return share;
}
- (AFHTTPSessionManager *)cslasjksjkdjareateReqMandkalkclsdkoalklxzlaldlkdkka{
    AFHTTPSessionManager *mag = [[AFHTTPSessionManager alloc]initWithBaseURL:[NSURL URLWithString:@"http://8.212.166.255:9893/uproarious"]];
    mag.requestSerializer = [AFJSONRequestSerializer serializer];
    
    return mag;
}
+ (void)JLYPostLAKd:(NSString *)url akdka:(id)skla refuslk:(void(^)(id res))sajkdfa adkla:(void(^)(NSError* sja))dkjak{
    NSLog(@"url===%@",url);
    NSLog(@"param===%@",skla);
    NSLog(@"url===%@",url);
    AFHTTPSessionManager *mag = [JLYAllshdjxgeuRequest JLYOnceSendReqMan].man;
    [mag.requestSerializer setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    [mag POST:url parameters:skla headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"success:%@", task.response.URL);
        if([responseObject isKindOfClass:[NSDictionary class]]){
            NSDictionary *req = [[NSDictionary alloc]initWithDictionary:responseObject];
            NSString *code = [NSString stringWithFormat:@"%@",req[@"sitting"]];
            if([code isEqualToString:@"-2"]){
                
            }
            
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"error:%@%@", task.response.URL,error);
    }];
}

@end
